package com.tdam2013.grupo04.modelo;

import java.util.ArrayList;
import java.util.UUID;

import android.content.Context;

public class ContactsCollection {

	 private static ContactsCollection contactsCollection;
	 private Context mAppContext;
	 private ArrayList<Contacto> contactos;

	 
	 private ContactsCollection(Context appContext) {
	 mAppContext = appContext;
	 contactos = new ArrayList<Contacto>();

	 }
	 
	 public static ContactsCollection get(Context c) {
	 if (contactsCollection == null) {
		 contactsCollection = new ContactsCollection(c.getApplicationContext());
	 }
	 return contactsCollection;
	 }
	 
	 public ArrayList<Contacto> getCrimes() {
		 return contactos;
		 }
	 
	public Contacto getCrime(UUID id) {
		for (Contacto c : contactos) {
		 if (c.getId().equals(id))
		 return c;
		 }
		 return null;
	}

	 

}
